package com.xlh.service.courseTest;

import cn.hutool.poi.excel.ExcelWriter;
import com.xlh.dto.course.TheoryChapterLeanTimeStatisticsDTO;
import com.xlh.dto.courseTest.experiment.TheoryChapterStatisticsExportDTO;
import com.xlh.dto.user.UserInfoDTO;
import com.xlh.param.course.TheoryChapterLeanTimeStatisticsParam;
import com.xlh.param.course.TheoryLeanTimeStatisticsParam;
import com.xlh.param.course.TheoryVideoStatisticsParam;
import com.xlh.pojo.course.TheoryLearnTimeStatistics;
import com.xlh.pojo.user.UserClass;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import java.util.List;

/**
 * @author sy
 */
public interface TheoryService {

    /**
     * 保存视频时长
     * @param theoryVideoStatisticsParam
     */
    void saveTheoryVideoTime(TheoryVideoStatisticsParam theoryVideoStatisticsParam);

    /**
     * 视频是否已经播放完成
     * @param theoryVideoStatisticsParam
     * @return
     */
    String theoryVideoIsFinal(TheoryVideoStatisticsParam theoryVideoStatisticsParam);

    /**
     *
     * @param theoryLeanTimeStatisticsParam
     */
    void theoryLearnTime(TheoryLeanTimeStatisticsParam theoryLeanTimeStatisticsParam);

    /**
     * 查询学生关联的视频总时长和观看视频总时长
     * @param courseId
     * @param classId
     * @param userId
     * @return
     */
    List<TheoryLearnTimeStatistics> findVideoSumInfo(Long courseId, Long classId, List<Long> userId, List<Long> chapterIds);

    /**
     * 章节学习时长统计
     * @param theoryLeanTimeStatisticsParam
     * @return
     */
    List<TheoryChapterLeanTimeStatisticsDTO> chapterLearnTime(TheoryChapterLeanTimeStatisticsParam theoryLeanTimeStatisticsParam);


    /**
     * 导出理论课
     * @param chapterId 章节ID
     * @param classId
     * @param userInfoDTOS
     * @param studentInfos
     * @return
     */
    public HSSFWorkbook exportChapterTheory(Long chapterId, Long classId, List<UserInfoDTO> userInfoDTOS, List<UserClass> studentInfos, String slogan);


    /**
     * 导出理论课查询的数据
     * @param chapterId
     * @param userInfoDTOS
     * @param studentInfos
     * @return
     */
    public List<TheoryChapterStatisticsExportDTO> getTheoryChapterStatisticsExportDTOS(Long chapterId, List<UserInfoDTO> userInfoDTOS, List<UserClass> studentInfos) ;

}
